public class num55 {
    //跳跃游戏
    public boolean canJump(int[] nums) {
        int max = 0;
        for (int i = 0; i < nums.length; i++) {
            if(max >= i) {
                max = Math.max(max,i + nums[i]);
                if(max > nums.length) {
                    return true;
                }
            }else {
                return false;
            }
        }
        return true;
    }
}
